package csu.big_article;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;

@SpringBootTest
public class redis {

    @Autowired
    private StringRedisTemplate template;

    @Test
    public void testStringSet(){
        ValueOperations<String,String> stringStringValueOperations = template.opsForValue();
        stringStringValueOperations.set("username","zhangsan");
    }

    @org.junit.jupiter.api.Test
    public void testRedis(){
        template.opsForValue().getOperations().delete("username");
    }
}
